﻿using System.Collections.Generic;

namespace Asd.MP.Utility
{
    /// <summary>
    /// 消息状态枚举
    /// </summary>
    public enum MessageStatus
    {
        /// <summary>
        /// 成功
        /// </summary>
        Ok = 1000,
        /// <summary>
        /// 失败
        /// </summary>
        Error = 2000,
        /// <summary>
        /// 提示
        /// </summary>
        Info = 3000,
        /// <summary>
        /// 警告
        /// </summary>
        Waring = 4000
    }
    /// <summary>
    /// 返回类型
    /// </summary>
    public enum ResultType
    {
        View,
        Json,
        Ajax
    }

    public class MessageException
    {
        /// <summary>
        /// 消息状态
        /// </summary>
        public MessageStatus Status { get; set; }
        /// <summary>
        /// 消息正文
        /// </summary>
        public string Body { get; set; }
        /// <summary>
        /// 返回类型
        /// </summary>
        public ResultType ResultType { get; set; }
        /// <summary>
        /// 返回为View时需要提供的ViewName
        /// </summary>
        public string ViewName { get; set; }
        /// <summary>
        /// 将要执行的操作，只所以这么做，有可能不是产生链接，可以用其他扩展方法产生例如button等html字符串
        /// </summary>
        public List<string> Operate { get; set; }
        /// <summary>
        /// 默认操作
        /// </summary>
        public string DefaultOperate { get; set; }
        /// <summary>
        /// 验证状态
        /// </summary>
        public bool IsValid { get; set; }
    }
    /// <summary>
    /// 返回消息 ViewModel
    /// </summary>
    public class MessageViewModel
    {
        /// <summary>
        /// 消息内容集合
        /// </summary>
        public List<string> MessageCollection { get; set; }
        /// <summary>
        /// 消息标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 消息正文 
        /// </summary>
        public string Body { get; set; }
        /// <summary>
        /// 消息状态
        /// </summary>
        public MessageStatus Status { get; set; }
        /// <summary>
        /// 执行操作
        /// </summary>
        public List<string> Operate { get; set; }
        /// <summary>
        /// ActionResult 的类型
        /// </summary>
        public ResultType ResultType { get; set; }
    }
}
